package com.lindroy.jetpacknotes.databinding

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.databinding.DataBindingUtil
import com.lindroy.jetpacknotes.R
import com.lindroy.jetpacknotes.databinding.bean.StudentBean

class DataBindingEventActivity : AppCompatActivity() {
    private lateinit var binding: ActivityDataBindingEventBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
         binding = DataBindingUtil.setContentView<ActivityDataBindingEventBinding>(
            this,
            R.layout.activity_data_binding_event
        )
        binding.clickListener = ButtonClickListener()
    }

   inner class ButtonClickListener {
        fun onButtonClick(view: View) {
            binding.student = StudentBean("韩梅梅","女",6)
            Toast.makeText(this@DataBindingEventActivity, "点击了", Toast.LENGTH_SHORT).show()
        }
    }
}